const path = require('path')

function resolve(dir) {
  return path.join(__dirname, dir)
}

module.exports = {
  publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
  assetsDir: 'static',
  runtimeCompiler: true,
  productionSourceMap: false,
  chainWebpack: (config) => {
    config.resolve.alias
      .set('@', resolve('src'))
      .set('assets', resolve('src/assets'))
      .set('views', resolve('src/views'))
      .set('components', resolve('src/components'))
      .set('basicLayoutComponent', resolve('src/views/components/basic'))
      .set('utils', resolve('src/utils'))
      .set('api', resolve('src/api'))
  },
  css: {
    loaderOptions: {
      less: {
        modifyVars: {
          // less vars，customize ant design theme

          'primary-color': '#F5222D',
          // 'link-color': '#F5222D',
          // 'border-radius-base': '2px'
        },
        javascriptEnabled: true
      }
    }
  }
}